Skip to content
This repository has been archived by the owner on Dec 7, 2022. It is now read-only.

Enable S3 storage. #433

Closed
wants to merge 1 commit into from
Closed

Enable S3 storage. #433

wants to merge 1 commit into from

Conversation

ipanova
Copy link
Member

@ipanova ipanova commented Oct 16, 2019

@ipanova ipanova force-pushed the fix-4456 branch 2 times, most recently from 3c700da to 8319f42 Compare October 16, 2019 11:16
file_response = web.FileResponse(path, headers=full_headers)
return file_response
elif settings.DEFAULT_FILE_STORAGE == 'storages.backends.s3boto3.S3Boto3Storage':
raise HTTPFound(file.url, headers=headers)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
raise HTTPFound(file.url, headers=headers)
raise HTTPFound(file.url, headers=full_headers)

n=os.path.basename(path))
file_response = web.FileResponse(path, headers=full_headers)
return file_response
n=os.path.basename(file.path))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
n=os.path.basename(file.path))
n=os.path.basename(file.file.name))


"""
full_headers = MultiDict()

full_headers['Content-Type'] = headers['Content-Type']
full_headers['Docker-Content-Digest'] = headers['Docker-Content-Digest']
full_headers['Docker-Distribution-API-Version'] = 'registry/2.0'
full_headers['Content-Length'] = os.path.getsize(path)
full_headers['Content-Length'] = file.size
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
full_headers['Content-Length'] = file.size
full_headers['Content-Length'] = str(file.size)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants